*merge in postal instrument
merge 1:1 czone year using "$dir/data/interim/postal_inst.dta"
drop _merge


*merge in bus instrument
merge 1:1 czone year using "$dir/data/interim/bus_inst.dta"
drop _merge

*merge in chiro instrument
merge 1:1 czone year using "$dir/data/interim/chiro_inst.dta"
drop _merge

gen postalpct = ind_share412*100 //scale up so more interpretable

gen buspct = ind_share401*100

sum buspct [aweight=czone_pop]

gen bus_norm = (buspct-r(mean))/r(sd)

gen chiropct = ind_share821*100

sum chiropct [aweight= czone_pop]
gen chiro_norm = (chiropct -r(mean))/r(sd)


foreach var in   bus_norm chiro_norm {

gen temp = `var' if year == 2007
gen temp2 = `var' if year == 2016
egen temp3 = min(temp), by(czone)
egen temp4 = min(temp2), by(czone)
gen `var'_dif = temp4-temp3

drop temp*
}
